package com.hu.common.exception;

import lombok.Getter;

/**
 * 自定义异常ServiceException，继承自RuntimeException
 * 在globalExceptionHandler里进行捕获，然后包装成Result对象发给前端
 */
@Getter
public class ServiceException extends RuntimeException {
    private Integer code;

    // 异常对象的构造器，传入code和msg
    public ServiceException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

}